ExamPlay Light Logo
로그인

Computer Science for IGCSE & O level - Programming (Section 3 - No. 16)

What is the main difference between a local and a global variable?
Local variables can be used anywhere in the program, and global variables can only be used in a single function.
Global variables are only for numbers, and local variables are for text.
Local variables are declared inside a function, and global variables are declared outside any function.
Local variables are more efficient than global variables.

설명

The key difference is their scope - where they can be accessed in the code.

댓글 (0)

댓글을 달려면 로그인하세요
광고
BrainBehindX Inc Logo
©2026; 에 의해 구동 BrainBehindX Inc